/**
 * Created by wanthering on 2017/8/18.
 */
'use strict'
const config = require('../../config/config')

exports.login = async function(ctx, next){
  let username = ctx.request.body.username
  let password = ctx.request.body.password
  if(username==="ririjin"&&password==='airijin612'){
    ctx.body = {
      success: true,
      jwt: config.jwt
    }
  }else{
    ctx.body={
      success:false
    }
  }
}

exports.checkJwt = async function(ctx, next){
  let jwt = ctx.request.body.jwt
  console.log(config.jwt)
  if(jwt === config.jwt){
    ctx.body= {
      success: true
    }
    }else{
      ctx.body = {
      success:false
      }
    }
}